From d8cba420938994fa3bc586ae70b9c8060f7cb851 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 12 Feb 2009 21:48:55 +0000 Subject: [PATCH] (image-toggle-display): Let-bind `buffer-file-truename' to nil around the call to `add-text-properties' to prevent directory time modification by lock_file. Replace `set-buffer-modified-p' with `restore-buffer-modified-p'. (Bug#2295) --- lisp/image-mode.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/image-mode.el b/lisp/image-mode.el index a5298d8eaa7..b7516522670 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -457,8 +457,9 @@ and showing the image as an image." (buffer-undo-list t) (modified (buffer-modified-p))) (image-refresh image) - (add-text-properties (point-min) (point-max) props) - (set-buffer-modified-p modified) + (let ((buffer-file-truename nil)) ; avoid changing dir mtime by lock_file + (add-text-properties (point-min) (point-max) props) + (restore-buffer-modified-p modified)) ;; Inhibit the cursor when the buffer contains only an image, ;; because cursors look very strange on top of images. (setq cursor-type nil) -- 2.30.2